Skip to content

Add automation group and Copilot task status tools - #3859

Open
A-Georgiou wants to merge 2 commits into
mainfrom
a-georgiou/automation-task-status
Open

A-Georgiou wants to merge 2 commits into
mainfrom
a-georgiou/automation-task-status

Conversation

@A-Georgiou

@A-Georgiou A-Georgiou commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the remaining hosted Copilot Automation tools to the public MCP server: five automation group tools (list_automation_groups, get_automation_group, create_automation_group, add_automation_to_group, remove_automation_from_group) and get_copilot_task_status. Same copilot_automations toolset and agent_automations flag as #3719, and the group writes follow #3867: no confirmation step, only delete_automation keeps one.

Why

Completes the open-source port of the hosted copilot_automations toolset for github/sweagentd#16692. It supersedes #3561, #3562 and #3563, using the hosted tool names (*_automation_group*) instead of tag names and adding the add/remove membership tools.

Before the hosted server uses these tools:

  • The public grouping REST API is enabled for the callers that will use these tools. github/copilot-mission-control#8984 has merged and the API works on github.com for accounts in the copilot_mission_control_public_automation_grouping_api rollout; github/github#474389 adds the GHE.com routes. github/github-mcp-server-remote#1111 migrates OSS automation tools by name, so the hosted server must not pin this change before then.
  • get_copilot_task_status matches the hosted CAPI version's limits (4 MiB upstream response, 100 sessions, 256 KiB of metadata), or the hosted cutover keeps that tool on CAPI.

What changed

  • list_automation_groups: GET /automation-tags, all pages; a 403, 404 or 503 returns groupingAvailable: false with the error, like the hosted tool.
  • get_automation_group: GET /automation-tags/{tag_id}, then lists member automations with tag_id and is_tag_membership_included=true, all pages.
  • create_automation_group: POST /automation-tags with a fresh idempotency_key, then reads the new group to confirm the result.
  • add_automation_to_group and remove_automation_from_group: read the group and the automation's membership, then PUT or DELETE /automations/{automation_id}/tags/{tag_id} with expected_tag_membership_version. They keep the hosted no-op detection and refuse to move an automation that already has a group.
  • get_copilot_task_status: GET /agents/tasks/{task_id}; requires a hyphenated UUID, rejects a response for a different task or with missing or duplicate task and session fields, and returns task and session IDs, states, timestamps and recorded errors without prompts or other session content.
  • Shared helper: an execute hook for operations that need several requests and a response projection hook. Like create, update and run, the group writes have no confirmation step and stay listed without request-state protection; every new tool rejects unknown arguments.
  • Tests, tool snapshots, skills catalog coverage exemptions and generated documentation.

Differences from the hosted tools: inputs keep the hosted group_id name (REST tag_id); expected_identity/identity are not supported, like the other OSS automation writes; groupUrl and artifactStorageNotice are omitted because the public API has no web URL or public tag storage endpoints.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed: the copilot_automations toolset description now mentions groups.
  • New tool added: six tools, available only with agent_automations enabled; read-only mode keeps the three read tools.

Prompts tested (tool changes only)

  • Mocked handler tests, not live model prompts, cover methods, paths, pagination, query parameters, request bodies and the API-version header for every tool, plus path-validation, flag-gating and read-only behavior, and that only delete_automation needs form elicitation.
  • Live, read-only: the REST calls behind the read tools return the expected data on github.com (group list, group by ID, and the tag_id member filter with is_tag_membership_included). No live write was performed.

Security / limits

  • No security or limits impact
  • Auth / permissions considered: requests use the authenticated GitHub REST client; get_copilot_task_status has no scope gate because the task endpoint authorizes the caller, matching the hosted tool.
  • Data exposure, filtering, or token/size limits considered: group writes have no confirmation step, like create, update and run (Keep automation confirmation on delete only and tighten tool schemas #3867), so membership changes check the live group and membership version, adding refuses to move a grouped automation, and an unconfirmed create is never retried; group names are sanitized like automation names, and hidden characters are removed from group descriptions and recorded task error text; paging is capped; task status drops prompts and its description marks error text as untrusted.

Tool renaming

  • I am renaming tools as part of this PR (e.g. as part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint: passed.
  • Tested locally with ./script/test: passed (go test -race ./...).
  • script/generate-docs leaves no drift.

Docs

  • Not needed
  • Updated (README / docs / examples): generated toolset and feature-flag documentation.


type copilotTaskSessionError struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
@A-Georgiou
A-Georgiou force-pushed the a-georgiou/automation-task-status branch from 197f417 to 6673d8f Compare November 16, 2026 01:30
@A-Georgiou A-Georgiou changed the title Add Copilot task status tool to agent automations Add automation group and Copilot task status tools Nov 16, 2026
func automationGroupResult(output map[string]any) (*mcp.CallToolResult, json.RawMessage, error) {
response, err := json.Marshal(output)
if err == nil {
response, err = sanitizeAutomationNames(response)
Base automatically changed from shaikhul-public-automation-mcp-stack to main November 16, 2026 12:36
if !ok {
return utils.NewToolResultError("Automation confirmation response is invalid. The operation was not performed."), nil
}
if confirmation.Action != "accept" {
return utils.NewToolResultErrorFromErr("failed to read GitHub agent automations response", err), nil, nil
}
}
sanitizedResponse, err := sanitizeAutomationNames(response)
@A-Georgiou
A-Georgiou force-pushed the a-georgiou/automation-task-status branch from 6673d8f to 9510884 Compare November 30, 2026 04:10
if add {
method = http.MethodPut
}
return newAgentAutomationTool[AutomationGroupMembershipInput](
if status.Sessions == nil {
status.Sessions = []copilotTaskSessionStatus{}
}
return json.Marshal(status)
@A-Georgiou
A-Georgiou marked this pull request as ready for review November 30, 2026 04:45
@A-Georgiou
A-Georgiou requested a review from a team as a code owner November 30, 2026 04:45
Copilot AI adaptive review requested due to automatic review settings November 30, 2026 04:45
@A-Georgiou
A-Georgiou force-pushed the a-georgiou/automation-task-status branch from 9510884 to aa7e6c3 Compare November 30, 2026 04:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new group and task-status tools omit IFC labels even when enabled, leaving private automation data and untrusted session errors without classifications used by client information-flow controls.

5 open issues
What changed in this PR

Extends the opt-in copilot_automations toolset with five automation-group tools and a Copilot task-status reader, continuing the move toward a shared public implementation.

Changes:

  • Adds group discovery, creation, and version-checked membership updates.
  • Adds task-status output containing selected metadata without prompts, transcripts, or events.
  • Updates registration, tests, schema snapshots, coverage exemptions, and generated documentation.
File Description
README.md Adds groups to the toolset description.
pkg/​skills/​catalog/​availability_test.go Exempts the six tools from bundled skill coverage.
pkg/​http/​handler_test.go Verifies group writes remain available without request-state protection.
pkg/​github/​tools.go Registers six tools and updates toolset metadata.
pkg/​github/​copilot_task_status.go Implements task validation and status projection.
pkg/​github/​copilot_task_status_test.go Tests projection and invalid task handling.
pkg/​github/​agent_automations.go Adds multi-request execution and response-projection hooks.
pkg/​github/​agent_automations_test.go Extends shared automation tests to the new tools.
pkg/​github/​agent_automation_groups.go Implements group operations, pagination, and membership checks.
pkg/​github/​agent_automation_groups_test.go Tests group requests, membership changes, and input validation.
pkg/​github/​__toolsnaps__/​remove_automation_from_group.snap Records the membership-removal schema.
pkg/​github/​__toolsnaps__/​list_automation_groups.snap Records the group-listing schema.
pkg/​github/​__toolsnaps__/​get_copilot_task_status.snap Records the task-status schema.
pkg/​github/​__toolsnaps__/​get_automation_group.snap Records the group-read schema.
pkg/​github/​__toolsnaps__/​create_automation_group.snap Records the group-creation schema.
pkg/​github/​__toolsnaps__/​add_automation_to_group.snap Records the membership-addition schema.
docs/​remote-server.md Updates the remote toolset description.
docs/​feature-flags.md Documents the six feature-gated tools and their inputs.

Review effort: Max (adaptive)

Comment on lines +185 to +186
if request.execute != nil {
return request.execute(ctx, client)
Comment thread pkg/github/agent_automation_groups.go Outdated
Comment on lines +261 to +270
groups, response, err := listAutomationGroupPages(ctx, client, path, "tags", nil)
if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, unconfirmed, response, err), nil, nil
}
for _, group := range groups {
if group["id"] == created.ID {
return automationGroupResult(map[string]any{"status": "created", "group": group})
}
}
return utils.NewToolResultError(unconfirmed), nil, nil
Comment on lines +73 to +74
method: http.MethodGet,
path: "agents/tasks/" + args.TaskID,
Comment on lines +75 to +76
project: func(response json.RawMessage) (json.RawMessage, error) {
return projectCopilotTaskStatus(args.TaskID, response)
Comment on lines +94 to +96
if status.Sessions == nil {
status.Sessions = []copilotTaskSessionStatus{}
}
A-Georgiou and others added 2 commits November 30, 2026 05:10
Port the hosted Copilot Automation group tools to the public automation
tags REST API: list_automation_groups, get_automation_group,
create_automation_group, add_automation_to_group and
remove_automation_from_group.

The tools join the copilot_automations toolset behind the
agent_automations feature flag. Like create, update and run, the group
mutations have no confirmation step, so clients without form
elicitation can list and call them; only delete_automation keeps one.
They are excluded in read-only mode and reject unknown arguments.
Membership changes first confirm the live group and membership version,
and adding refuses to move an automation that already references
another group. Membership reads use the published
is_tag_membership_included parameter, kept in one constant.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
Copilot-Session: 86b2b275-fbfe-4bb3-90b6-4c44fa0989f4
Port the hosted get_copilot_task_status tool onto the public GET /agents/tasks/{task_id} endpoint. It returns the same metadata-only snapshot as the hosted tool, without prompts or other session content.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f921ed41-2ec0-4075-a572-7692f9529b7e
Copilot-Session: 86b2b275-fbfe-4bb3-90b6-4c44fa0989f4
@A-Georgiou
A-Georgiou force-pushed the a-georgiou/automation-task-status branch from 3de6aec to fa9ae60 Compare November 30, 2026 05:11
)
}

func automationGroupMembershipTool(t translations.TranslationHelperFunc, add bool, name, title, description string, annotations mcp.ToolAnnotations) inventory.ServerTool {
if err != nil {
return ghErrors.NewGitHubAPIErrorResponse(ctx, "failed to list automation group members", response, err), nil, nil
}
return automationGroupResult(map[string]any{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants